package cn.zhc.com.utils;

import android.util.Log;

/**
 * Created by zhouhongchun on 2017/8/14.
 */

public class UtilsLog {
    public static final String TAG = "zhc";
    /**
     *	全局的总开关
     */
    public static boolean LogEnable = false;
    /**
     *	LOWEST_LOG_LEVEL表示日志的显示级别，只有级别大于LOWEST_LOG_LEVEL的日志才显示
     * 	0表示不显示
     *
     */
    public static int LOWEST_LOG_LEVEL = 3;
    /**
     *	日志级别
     */
    private static int SYSTEM = 1;
    private static int VERBOS = 2;
    private static int DEBUG = 3;
    private static int INFO = 4;
    private static int WARN = 5;
    private static int ERROR = 6;

    public static void s(String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= SYSTEM) {
            System.out.println(message);
        }
    }

    public static void v(String tag, String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= VERBOS) {
            Log.v(tag, message);
        }
    }

    public static void d(String tag, String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= DEBUG) {
            Log.d(tag, message);
        }
    }

    public static void i(String tag, String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= INFO) {//
            Log.i(tag, message);
        }
    }

    public static void w(String tag, String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= WARN) {
            Log.w(tag, message);
        }
    }

    public static void e(String tag, String message) {
        if(message==null){
            return;
        }
        if (LOWEST_LOG_LEVEL <= ERROR) {
            Log.e(tag, message);
        }
    }
}
